local thbattle__lingmeng_kuaiqing = fk.CreateSkill {

  name = "thbattle__lingmeng_kuaiqing",

  tags = {  },

}



thbattle__lingmeng_kuaiqing:addEffect(fk.Damage, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(thbattle__lingmeng_kuaiqing.name) and target == player and data.to ~= player
  end,
  on_cost = function(self, event, target, player, data)
    local prompt = "#thbattle__lingmeng_kuaiqing1:" .. data.to.id
    if player.phase == Player.NotActive then
      prompt = "#thbattle__lingmeng_kuaiqing2:" .. data.to.id .. ":" .. Fk:currentRoom().current.id
    end
    return player.room:askForSkillInvoke(player, thbattle__lingmeng_kuaiqing.name, nil, prompt)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(1, thbattle__lingmeng_kuaiqing.name)
    data.to:drawCards(1, thbattle__lingmeng_kuaiqing.name)
    if player.phase == Player.NotActive and Fk:currentRoom().current.id ~ player.id and Fk:currentRoom().current.phase == Player.Play then
      local event = room.logic:getCurrentEvent():findParent(GameEvent.Phase)
      if not event then return end
      event:shutdown()
    end
  end,
})

return thbattle__lingmeng_kuaiqing